import os
import yaml

def read_yaml(yaml_file_path):
    try:
        with open(yaml_file_path, "r",encoding="utf-8") as f:
            value = yaml.load(stream=f, Loader=yaml.Loader)
    except:
        with open(yaml_file_path, "r", encoding="gbk") as f:
            value = yaml.load(stream=f, loader=yaml.Loader)
    print(value)
    return value


if __name__ == '__main__':
    read_yaml(r"E:\test\pythonProject\case\test_yaml.yaml")